package cn.tedu.fengyuback.personal.controller;

import cn.tedu.fengyuback.base.response.JsonResult;
import cn.tedu.fengyuback.personal.pojo.dto.ArticlesQuery;
import cn.tedu.fengyuback.personal.pojo.vo.ArticlesVO;
import cn.tedu.fengyuback.personal.service.RepliedService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping(value = "/v1/personal/replied")
public class RepliedController {
    @Autowired
    private RepliedService repliedService;

    /**
     * 查询用户的回答
     * @param userId
     * @param questionId
     * @return
     */
    @GetMapping("loadReplied")
    public JsonResult selectReplied(Long userId,Long questionId){
        log.debug("查询回答的信息：userId={},questionId={}",userId,questionId);
        List<ArticlesVO> list = repliedService.selectReplied(userId,questionId);
        return JsonResult.ok(list);
    }
}
